<!DOCTYPE html>
<html>
<head lang="en">
  <meta charset="UTF-8">
  <title>我的首页</title>
  <link rel="stylesheet" href="/javascripts/doc/css/reset.css">
  <link rel="stylesheet" href="/javascripts/doc/css/style.css">
  <link rel="stylesheet" href="/javascripts/quanxian.js">
  <script src="/javascripts/doc/jquery-3.1.1.js"></script>
  <script src="/javascripts/jquery.js"></script>
  <script src="/javascripts/angular.js"></script>
  <script src="/plugin/bootstrap/js/bootstrap.js"></script>
  <script src="/javascripts/controller.js"></script>
  <script src="/javascripts/lib/angular-ui-router.js"></script>
  <link rel="stylesheet" href="/plugin/bootstrap/css/bootstrap.css">
  <link rel="stylesheet" href="/stylesheets/style.css">
    <link rel="stylesheet" href="/stylesheets/media.css">
</head>
<body style="overflow-x: hidden">
<header>
  <div ui-view="top" class="top">

    <a href="/"><img  src="/images/logo.png" alt="MY社区的logo"/></a>
    <img class="logo2" src="/images/zjiti.png" alt="MY社区的logo"/>
      <form style="margin:0;padding: 0;display: inline-block" action="/search" method="POST">

      <input name="title" style="position: absolute;right: 300px;border-radius: 10px;top: 10px;" type="text" placeholder="搜索......"/>
      </form>

      <div class="ownUser">
      <% if(user) {%>
      <p>
        <span style="font-size: 20px">欢迎您:</span><span><a style="font-size: 16px" href="/userModify"><%= user.userName %><img style="width: 40px;height: 40px;border-radius: 50%" src=/userpic/<%= user.userpic %> alt=""></a><a class="reg" href="/loginout" style="font-size: 16px">退出</a></span>
      </p>

      <% }else{ %>
      <a class="login" style="font-size: 16px" data-toggle="modal" data-target=".bs-example-modal-lg">登陆</a>

      <!--登录模态框-->
      <div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
        <div class="modal-dialog modal-lg">
          <div class="modal-content" ng-app="user_Login" >
            <div class="loginBoard" ng-controller="userLogin">
              <form name="loginForm" ng-submit="processLoginForm(loginForm.$valid)" novalidate>
                <h3>用户登录 &nbsp;<small class="text-danger hide" id="errorInfo">邮箱和密码不匹配</small></h3>
                <div class="form-group">
                  <input style="margin: 0;width: 100%" type="email" class="form-control" name="email" ng-model="logFormData.email" ng-pattern="/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/" placeholder="请填写邮箱"  required>
                  <label ng-cloak for="inputError" class="control-label text-danger" ng-show="loginForm.email.$invalid && !loginForm.email.$pristine"><i class="glyphicon glyphicon-info-sign"></i> 请填写正确的邮箱地址</label>
                </div>
                <div class="form-group">
                  <input style="margin: 0;width: 100%" type="password" class="form-control" name="password" ng-model="logFormData.password" ng-pattern="/(?!^\\d+$)(?!^[a-zA-Z]+$)(?!^[_#@]+$).{5,}/" ng-maxlength="12" placeholder="请输入密码" required>
                  <label ng-cloak for="inputError" class="control-label text-danger" ng-show="loginForm.password.$invalid && !loginForm.password.$pristine"><i class="glyphicon glyphicon-info-sign"></i> 6-12位，只能包含字母、数字和下划线</label>
                </div>
                <div id="ul-s5">
                  <button style=" font-size:20px;background-color: #0f0f0f;color: white;width: 100%" type="submit" class="btn btn-default" ng-disabled="loginForm.$invalid">登&nbsp;&nbsp;&nbsp;&nbsp;录</button>&nbsp;
                  <!--<small><a href="/users/lostPassword">忘记密码？</a></small>-->
                </div>
              </form>
            </div>
          </div>
        </div>
      </div>



      <a class="reg" style="font-size: 16px" href="/reg">注册</a>

      <% } %>
    </div>
  </div>


</header>
